<div class="subrow">
    <div class="subcol1"></div>
    <div class="subcol2">
        <img src="images/bank/method3.jpg" width="533" height="114" alt="">
    </div>
    <div class="clear"></div>
</div>
<div id="test"></div>
<div class="subrow">
    <div class="subcol1">银行种类：</div>
    <div class="subcol2" id="bank-subcol">
    </div>
    <div class="clear"></div>
</div>

<div class="subrow">
    <div class="subcol1"></div>
    <div class="subcol2 smalltxt gray">
        温馨提示：为确保财务第一时间为您添加游戏额度，请您尽量不要转账整数（例如：欲入￥5000，请￥5000.68）谢谢！<br>
        <span class="blue">友情提示：请每次入款前登录会员核对银行账号是否使用。入款至已过期账号，公司无法查收，恕不负责！<br>在您转账成功后，请点击“我已存款”，通知客服确认到账哦！
        </span>
    </div>
    <div class="clear"></div>
</div>

<div class="subrow margintop10">
    <div class="subcol1"></div>
    <div class="subcol2">
        <input type="submit" class="c-button" value="开始充值" id="start-charge">
    </div>
    <div class="clear"></div>
</div>

<script>
    // 将银行列表填入表格中
    var banks = [];
    context.center.chargeType = "bank";
    ME.query(function() {
        Classify.queryExt("money", "banks", true, [], function(r) {
            var grade = context.user.user.layer || 0;
            grade = grade + '';
            for (var i in r) {
                if (r[i].enable != 1) continue;
                if (r[i].layer.indexOf(grade) == -1) continue;
                banks.push(r[i]);
            }
            banks.sort(function(a, b) {
                return (b.sort || 0) - (a.sort || 0);
            });
            
            // 填充银行列表
            var l = '<div class="banklist marginbtm10">\
                <input type="radio" name="bank" value="__v__"\
                    style="margin-top:0px;margin-left: 3px;">\
                <i class="ico-__icon__"></i>\
                <span style="padding-right: 8px;">__v__</span>\
            </div>';
            for (var i in banks) {
                var div = l.replace(/__v__/g, banks[i].bank);
                div = div.replace(/__icon__/, Util.getBankIcon(banks[i].bank));
                $("#bank-subcol").append(div);
            }
            $("#bank-subcol input")[0].checked = true;

            $(".banklist span").click(function(e) {
                var input = $(e.currentTarget).parent().find("input")[0];
                if (!input.checked) input.checked= true;
            });
        });
    });

    $("#start-charge").click(function() {
        window.context.user.layer = layer.open({
			type : 2,
			title : '订单信息',
			scrollbar : false,
			closeBtn : 0,
			shade : [ 0.5 ],
			area : [ '580px', '540px' ],
			content : "pages/center/charge/pay_window.html"
		});
        $(".layui-layer iframe").css("height", "508px");
    });

    // 取得使用的充值银行信息
    function getSelectBankInfo() {
        var v = $("input:radio:checked").attr("value");
        for (var i in banks) {
            if (banks[i].bank == v) return banks[i];
        }
    }
</script>